<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <meta content="telephone=no" name="format-detection">
        <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
        <title>竞猜</title>
        <script src="https://cdn.bootcss.com/blueimp-md5/2.7.0/js/md5.min.js"></script>
        <!-- 微派-H5支付 -->
    </head>
    <body>
        位置：<a href="{:url('index/index')}">首页</a> &raquo; 竞猜
        <form method="post" action="{:url('game.wiipayh5/doWiipayh5')}">
            <div>大：<input type="number" name="da" />倍</div>
            <div>小：<input type="number" name="xiao" />倍</div>
            <div>单：<input type="number" name="dan" />倍</div>
            <div>双：<input type="number" name="shuang" />倍</div>
            <div><button type="submit">支付1分钱下注</button></div>
            {:token()}
        </form>
        <script type="text/javascript" src="/public/static/js/jquery-3.2.1.min.js"></script>
        <!-- #################微派支付--H5支付--集成示例2.0#################开始######################-->
        <!--1.添加控制台活的的script标签，实际项目中请替换真实appId-->
        <script id="wpay-jspay-script" src="http://jspay.wiipay.cn/1/jspay/wpayscripts.do?appId=3db1cffa7cdd7c68b80d8775dc61b5e2"></script>
        <script>
            $('button').click(function () {
                var $form = $('form');
                $.post($form.attr('action'), $form.serialize(), function (msg) {
                    if(!msg.success){
                        alert(msg.message);
                        return;
                    }
                    WP.click(msg.message);
                    /**
                     * click调用错误返回：默认行为console.log(err)
                     */
                    WP.err = function (err) {
                        //err 为object, 例 ｛"ERROR" : "xxxx"｝;
                        console.log(err);
                    }
                })
                //wiih5pay();
                return false;
            })
        </script>
        <!-- #################微派支付--H5支付--集成示例2.0#################结束######################-->
    </body>
</html>
